PowerTCP Emulation for .NET
Read(Byte[],Int32,Int32) Method




The byte array used to store the received data.
The position in the buffer to store the data.
The maximum number of bytes to receive.
Receives data from the remote host.
Syntax
Public Overloads Function Read( _
   ByVal buffer() As Byte, _
   ByVal offset As Integer, _
   ByVal count As Integer _
) As Data
Dim instance As TcpBase
Dim buffer() As Byte
Dim offset As Integer
Dim count As Integer
Dim value As Data
 
value = instance.Read(buffer, offset, count)
public Data Read( 
   byte[] buffer,
   int offset,
   int count
)
public: Data* Read( 
   byte[]* buffer,
   int offset,
   int count
) 
public:
Data^ Read( 
   array<byte>^ buffer,
   int offset,
   int count
) 

Parameters

buffer
The byte array used to store the received data.
offset
The position in the buffer to store the data.
count
The maximum number of bytes to receive.

Return Value

A Data object encapsulating the received data. Returns null if the socket is closed.
Remarks

This method performs a single socket read, blocking until at least one byte is read, up to as much data as is available on the socket, count bytes, or buffer.Length, whichever is lowest. A SocketException indicating SocketError.Timeout will not result in the socket being closed; other SocketExceptions are fatal and the socket is automatically closed by the class.

The ReceiveTimeout property controls how long this method will block before throwing a Timeout exception.

See Also

Reference

TcpBase Class
TcpBase Members
Overload List


PowerTCP Emulation for .NET Documentation Version 4.7
© 2018 Dart Communications. All Rights Reserved.
Send comments on this topic